<?xml version="1.0" encoding="UTF-8"?>
<html filename="docs/SAXHelpers/TAttributesImpl.html">
<body>
<a id="#top"/>
<h1>
	                Class Summary : TAttributesImpl </h1> Default implementation of the Attributes interface.

 <blockquote>
 <em>This module, both source code and documentation, is in the
 Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
 </blockquote>

 <p>This class provides a default implementation of the SAX2
 <a href="../SAX/IAttributes.html">IAttributes</a> interface, with the
 addition of manipulators so that the list can be modified or
 reused.</p>

 <p>There are two typical uses of this class:</p>

 <ol>
 <li>to take a persistent snapshot of an Attributes object
  in a <a href="../SAX/IContentHandler.html#startElement">startElement</a> event; or</li>
 <li>to construct or modify an IAttributes object in a SAX2 driver or filter.</li>
 </ol>

 <p>This class replaces the now-deprecated SAX1 AttributeListImpl
 class; in addition to supporting the updated Attributes
 interface rather than the deprecated <a href="../SAX/IAttributeList.html">IAttributeList</a>
 interface, it also includes a much more efficient
 implementation using a single array rather than a set of Vectors.</p>

<br/><b>Since : </b> SAX 2.0
<h2>
	              Methods
	            </h2>
<div style="padding-left:10px">
<a href="#ensureCapacity">
	                  procedure
	                 ensureCapacity(Integer)</a>
<br/>
<a href="#badIndex">
	                  procedure
	                 badIndex(Integer)</a>
<br/>
<a href="#getLength">
	                  function
	                 getLength() : Integer</a>
<br/>
<a href="#getURI">
	                  function
	                 getURI(Integer) : SAXString</a>
<br/>
<a href="#getLocalName">
	                  function
	                 getLocalName(Integer) : SAXString</a>
<br/>
<a href="#getQName">
	                  function
	                 getQName(Integer) : SAXString</a>
<br/>
<a href="#getType">
	                  function
	                 getType(Integer) : SAXString</a>
<br/>
<a href="#getType">
	                  function
	                 getType(SAXString, SAXString) : SAXString</a>
<br/>
<a href="#getType">
	                  function
	                 getType(SAXString) : SAXString</a>
<br/>
<a href="#getValue">
	                  function
	                 getValue(Integer) : SAXString</a>
<br/>
<a href="#getValue">
	                  function
	                 getValue(SAXString, SAXString) : SAXString</a>
<br/>
<a href="#getValue">
	                  function
	                 getValue(SAXString) : SAXString</a>
<br/>
<a href="#getIndex">
	                  function
	                 getIndex(SAXString, SAXString) : Integer</a>
<br/>
<a href="#getIndex">
	                  function
	                 getIndex(SAXString) : Integer</a>
<br/>
<a href="#clear">
	                  procedure
	                 clear()</a>
<br/>
<a href="#setAttributes">
	                  procedure
	                 setAttributes(IAttributes)</a>
<br/>
<a href="#addAttribute">
	                  procedure
	                 addAttribute(SAXString, SAXString, SAXString, SAXString, SAXString)</a>
<br/>
<a href="#setAttribute">
	                  procedure
	                 setAttribute(Integer, SAXString, SAXString, SAXString, SAXString, SAXString)</a>
<br/>
<a href="#removeAttribute">
	                  procedure
	                 removeAttribute(Integer)</a>
<br/>
<a href="#setURI">
	                  procedure
	                 setURI(Integer, SAXString)</a>
<br/>
<a href="#setLocalName">
	                  procedure
	                 setLocalName(Integer, SAXString)</a>
<br/>
<a href="#setQName">
	                  procedure
	                 setQName(Integer, SAXString)</a>
<br/>
<a href="#setType">
	                  procedure
	                 setType(Integer, SAXString)</a>
<br/>
<a href="#setValue">
	                  procedure
	                 setValue(Integer, SAXString)</a>
<br/>
</div>
<br/>
<hr width="100%"/>
<a name="#ensureCapacity">
<p>
<b>procedure</b> ensureCapacity( n : Integer); </p>
</a> Ensure the internal array's capacity.

<br/><b>Parameter : </b> n The minimum number of attributes that the array must
        be able to hold.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#badIndex">
<p>
<b>procedure</b> badIndex( index : Integer); </p>
</a> Report a bad array index in a manipulator.

<br/><b>Parameter : </b> index The index to report.
<br/><b>Exception : </b> Exception Always.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getLength">
<p>
<b>function</b> getLength() : Integer; </p>
</a> Return the number of attributes in the list.

<br/><b>Result : </b> The number of attributes in the list.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getLength">IAttributes.getLength</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getURI">
<p>
<b>function</b> getURI( index : Integer) : SAXString; </p>
</a> Return an attribute's Namespace URI.

<br/><b>Parameter : </b> index The attribute's index (zero-based).
<br/><b>Result : </b> The Namespace URI, the empty string if none is
         available or if the index is out of range.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getURI">IAttributes.getURI</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getLocalName">
<p>
<b>function</b> getLocalName( index : Integer) : SAXString; </p>
</a> Return an attribute's local name.

<br/><b>Parameter : </b> index The attribute's index (zero-based).
<br/><b>Result : </b> The attribute's local name, the empty string if
         none is available or if the index if out of range.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getLocalName">IAttributes.getLocalName</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getQName">
<p>
<b>function</b> getQName( index : Integer) : SAXString; </p>
</a> Return an attribute's qualified (prefixed) name.

<br/><b>Parameter : </b> index The attribute's index (zero-based).
<br/><b>Result : </b> The attribute's qualified name, the empty string if
         none is available or if the index is out of bounds.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getQName">IAttributes.getQName</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getType">
<p>
<b>function</b> getType( index : Integer) : SAXString; </p>
</a> Return an attribute's type by index.

<br/><b>Parameter : </b> index The attribute's index (zero-based).
<br/><b>Result : </b> The attribute's type, 'CDATA' if the type is unknown, or an empty
         string if the index is out of bounds.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getType.Integer">IAttributes.getType(Integer)</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getType">
<p>
<b>function</b> getType(<b>const</b> uri : SAXString; <b>const</b> localName : SAXString) : SAXString; </p>
</a> Look up an attribute's type by Namespace-qualified name.

<br/><b>Parameter : </b> uri The Namespace URI, or the empty string for a name
        with no explicit Namespace URI.
<br/><b>Parameter : </b> localName The local name.
<br/><b>Result : </b> The attribute's type, or an empty if there is no
         matching attribute.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getType.SAXString.SAXString">IAttributes.getType(SAXString,SAXString)</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getType">
<p>
<b>function</b> getType(<b>const</b> qName : SAXString) : SAXString; </p>
</a> Look up an attribute's type by qualified (prefixed) name.

<br/><b>Parameter : </b> qName The qualified name.
<br/><b>Result : </b> The attribute's type, or an empty string if there is no
         matching attribute.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getType.SAXString">IAttributes.getType(SAXString)</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getValue">
<p>
<b>function</b> getValue( index : Integer) : SAXString; </p>
</a> Return an attribute's value by index.

<br/><b>Parameter : </b> index The attribute's index (zero-based).
<br/><b>Result : </b> The attribute's value or an empty string if the index is
         out of bounds.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getValue.Integer">IAttributes.getValue(Integer)</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getValue">
<p>
<b>function</b> getValue(<b>const</b> uri : SAXString; <b>const</b> localName : SAXString) : SAXString; </p>
</a> Look up an attribute's value by Namespace-qualified name.

<br/><b>Parameter : </b> uri The Namespace URI, or the empty string for a name
        with no explicit Namespace URI.
<br/><b>Parameter : </b> localName The local name.
<br/><b>Result : </b> The attribute's value, or an empty string if there is no
         matching attribute.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getValue.SAXString.SAXString">IAttributes.getValue(SAXString,SAXString)</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getValue">
<p>
<b>function</b> getValue(<b>const</b> qName : SAXString) : SAXString; </p>
</a> Look up an attribute's value by qualified (prefixed) name.

<br/><b>Parameter : </b> qName The qualified name.
<br/><b>Result : </b> The attribute's value, or an empty string if there is no
         matching attribute.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getValue.SAXString">IAttributes.getValue(SAXString)</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getIndex">
<p>
<b>function</b> getIndex(<b>const</b> uri : SAXString; <b>const</b> localName : SAXString) : Integer; </p>
</a> Look up an attribute's index by Namespace name.

 <p>In many cases, it will be more efficient to look up the name once and
 use the index query methods rather than using the name query methods
 repeatedly.</p>

<br/><b>Parameter : </b> uri The attribute's Namespace URI, or the empty
        string if none is available.
<br/><b>Parameter : </b> localName The attribute's local name.
<br/><b>Result : </b> The attribute's index, or -1 if none matches.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getIndex.SAXString.SAXString">IAttributes.getIndex(SAXString,SAXString)</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getIndex">
<p>
<b>function</b> getIndex(<b>const</b> qName : SAXString) : Integer; </p>
</a> Look up an attribute's index by qualified (prefixed) name.

<br/><b>Parameter : </b> qName The qualified name.
<br/><b>Result : </b> The attribute's index, or -1 if none matches.
<br/><b>See : </b> <a href="../SAX/IAttributes.html#getIndex.SAXString">IAttributes.getIndex(SAXString)</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#clear">
<p>
<b>procedure</b> clear(); </p>
</a> Clear the attribute list for reuse.

 <p>Note that little memory is freed by this call:
 the current array is kept so it can be
 reused.</p>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setAttributes">
<p>
<b>procedure</b> setAttributes(<b>const</b> atts : IAttributes); </p>
</a> Copy an entire Attributes object.

 <p>It may be more efficient to reuse an existing object
 rather than constantly allocating new ones.</p>

<br/><b>Parameter : </b> atts The attributes to copy.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#addAttribute">
<p>
<b>procedure</b> addAttribute(<b>const</b> uri : SAXString; <b>const</b> localName : SAXString; <b>const</b> qName : SAXString; <b>const</b> attrType : SAXString; <b>const</b> value : SAXString); </p>
</a> Add an attribute to the end of the list.

 <p>For the sake of speed, this method does no checking
 to see if the attribute is already in the list: that is
 the responsibility of the application.</p>

<br/><b>Parameter : </b> uri The Namespace URI, or the empty string if
        none is available or Namespace processing is not
        being performed.
<br/><b>Parameter : </b> localName The local name, or the empty string if
        Namespace processing is not being performed.
<br/><b>Parameter : </b> qName The qualified (prefixed) name, or the empty string
        if qualified names are not available.
<br/><b>Parameter : </b> type The attribute type as a string.
<br/><b>Parameter : </b> value The attribute value.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setAttribute">
<p>
<b>procedure</b> setAttribute( index : Integer; <b>const</b> uri : SAXString; <b>const</b> localName : SAXString; <b>const</b> qName : SAXString; <b>const</b> attrType : SAXString; <b>const</b> value : SAXString); </p>
</a> Set an attribute in the list.

 <p>For the sake of speed, this method does no checking
 for name conflicts or well-formedness: such checks are the
 responsibility of the application.</p>

<br/><b>Parameter : </b> index The index of the attribute (zero-based).
<br/><b>Parameter : </b> uri The Namespace URI, or the empty string if
        none is available or Namespace processing is not
        being performed.
<br/><b>Parameter : </b> localName The local name, or the empty string if
        Namespace processing is not being performed.
<br/><b>Parameter : </b> qName The qualified name, or the empty string
        if qualified names are not available.
<br/><b>Parameter : </b> type The attribute type as a string.
<br/><b>Parameter : </b> value The attribute value.
<br/><b>Exception : </b> Exception when the supplied index does not
            point to an attribute in the list.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#removeAttribute">
<p>
<b>procedure</b> removeAttribute( index : Integer); </p>
</a> Remove an attribute from the list.

<br/><b>Parameter : </b> index The index of the attribute (zero-based).
<br/><b>Exception : </b> Exception when the supplied index does not
            point to an attribute in the list.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setURI">
<p>
<b>procedure</b> setURI( index : Integer; <b>const</b> uri : SAXString); </p>
</a> Set the Namespace URI of a specific attribute.

<br/><b>Parameter : </b> index The index of the attribute (zero-based).
<br/><b>Parameter : </b> uri The attribute's Namespace URI, or the empty
        string for none.
<br/><b>Exception : </b> Exception when the supplied index does not
            point to an attribute in the list.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setLocalName">
<p>
<b>procedure</b> setLocalName( index : Integer; <b>const</b> localName : SAXString); </p>
</a> Set the local name of a specific attribute.

<br/><b>Parameter : </b> index The index of the attribute (zero-based).
<br/><b>Parameter : </b> localName The attribute's local name, or the empty
        string for none.
<br/><b>Exception : </b> Exception when the supplied index does not
            point to an attribute in the list.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setQName">
<p>
<b>procedure</b> setQName( index : Integer; <b>const</b> qName : SAXString); </p>
</a> Set the qualified name of a specific attribute.

<br/><b>Parameter : </b> index The index of the attribute (zero-based).
<br/><b>Parameter : </b> qName The attribute's qualified name, or the empty
        string for none.
<br/><b>Exception : </b> Exception when the supplied index does not
            point to an attribute in the list.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setType">
<p>
<b>procedure</b> setType( index : Integer; <b>const</b> attrType : SAXString); </p>
</a> Set the type of a specific attribute.

<br/><b>Parameter : </b> index The index of the attribute (zero-based).
<br/><b>Parameter : </b> type The attribute's type.
<br/><b>Exception : </b> Exception when the supplied index does not
            point to an attribute in the list.
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setValue">
<p>
<b>procedure</b> setValue( index : Integer; <b>const</b> value : SAXString); </p>
</a> Set the value of a specific attribute.

<br/><b>Parameter : </b> index The index of the attribute (zero-based).
<br/><b>Parameter : </b> value The attribute's value.
<br/><b>Exception : </b> Exception when the supplied index does not
            point to an attribute in the list.
<br/>
<p>
<a href="#top">Top</a>
</p>
</body>
</html>